<?xml version="1.0"?>
<properties>
  <target name="parseProjectProps" description="Load the projects list in projects.txt, and write the variables">
    <echo message="parse.projects: ${projects.fullpath}"/>
    <property name="dest.cofe.data.s3db" value="COFEDB2.sqlite" />
    <script language="C#">
      <references>
        <include name="System.dll" />
      </references>
      <imports>
        <import namespace="System.Text.RegularExpressions" />
      </imports>
      <code>
        <![CDATA[
        public static void ScriptMain(Project project)
        {
           string fileName = @"projects.txt";
           string srcAppPath = project.Properties["src.app.path"];           
           
           using (StreamReader sr = new StreamReader(fileName))
             while (!sr.EndOfStream)
             {
               string projectName = sr.ReadLine();
               
               //<property name="dest.cofe.core.bin" value="COFE.Core.dll" />
               //<property name="dest.cofe.core.pdb" value="COFE.Core.pdb" />               
               project.Properties.Add(String.Format("dest.{0}.bin", projectName.ToLower()) 
                   , projectName + ".dll");
               project.Properties.Add(String.Format("dest.{0}.pdb", projectName.ToLower()) 
                   , projectName + ".pdb");
               
               //<property name="src.cofe.core.path" value="${src.app.path}\COFE.Core" />
               //<property name="src.cofe.core.csproj" value="${src.app.path}\COFE.Core.csproj" />
               project.Properties.Add(String.Format("src.{0}.path", projectName.ToLower())
                   , String.Format("{0}{1}\\", srcAppPath, projectName) );
               project.Properties.Add(String.Format("src.{0}.csproj", projectName.ToLower())
                   , String.Format("{0}{1}\\{1}.csproj", srcAppPath, projectName));
             }                  
        }
      ]]>
      </code>
    </script>
    <echo message="src.cofe.core.path = ${src.cofe3.core.path}"/>
    <echo message="src.cofe.core.csproj = ${src.cofe3.core.csproj}"/>
    <echo message="dest.cofe.core.bin = ${dest.cofe3.core.bin}"/>
    <echo message="dest.cofe.core.pdb = ${dest.cofe3.core.pdb}"/>
    
  </target>
</properties>